# Once done, this will define
#
#  libIPCProtocol_INCLUDE_DIR - the libIPCProtocol include directory
#  libIPCProtocol_LIBRARY_DIR - the libIPCProtocol library directory
#  libIPCProtocol_LIBS - link these to use libIPCProtocol
#
#  ......

MACRO(LOAD_LIBlibIPCProtocol os arch)
    MESSAGE(INFO "--------------------------------")
    SET(3RDPARTY_DIR ${PROJECT_SOURCE_DIR}/3rdparty/target/${${os}}_${${arch}})
    MESSAGE(STATUS "3RDPARTY_DIR: ${3RDPARTY_DIR}")
    #FIND_FILE(libIPCProtocol_INCLUDE_DIR include ${3RDPARTY_DIR} NO_DEFAULT_PATH)
    #FIND_FILE(libIPCProtocol_LIBRARY_DIR lib ${3RDPARTY_DIR} NO_DEFAULT_PATH)
    SET(libIPCProtocol_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/3rdparty/libIPCProtocol/src/libIPCProtocol)
    SET(libIPCProtocol_LIBRARY_DIR ${PROJECT_SOURCE_DIR}/3rdparty/target/${${os}}_${${arch}}/lib)
    SET(librkdb_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/3rdparty/libIPCProtocol/src/librkdb)
    SET(librkdb_LIBRARY_DIR ${PROJECT_SOURCE_DIR}/3rdparty/target/${${os}}_${${arch}}/lib)

    IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
        SET(libIPCProtocol_LIBS IPCProtocol)
    ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Windows")
        SET(libIPCProtocol_LIBS IPCProtocol)
    ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux")

    IF(libIPCProtocol_INCLUDE_DIR)
        SET(libIPCProtocol_LIBRARY_DIR "${libIPCProtocol_LIBRARY_DIR}/libIPCProtocol")
        SET(librkdb_LIBRARY_DIR "${libIPCProtocol_LIBRARY_DIR}/librkdb")
        #SET(libIPCProtocol_LIBS "${libIPCProtocol_LIBRARY_DIR}/libIPCProtocol.so")
        MESSAGE(STATUS "libIPCProtocol_INCLUDE_DIR : ${libIPCProtocol_INCLUDE_DIR}")
        MESSAGE(STATUS "libIPCProtocol_LIBRARY_DIR : ${libIPCProtocol_LIBRARY_DIR}")
        MESSAGE(STATUS "libIPCProtocol_LIBS : ${libIPCProtocol_LIBS}")
    ELSE()
        MESSAGE(FATAL_ERROR "libIPCProtocol_LIBS not found!")
    ENDIF()
ENDMACRO()
